<!DOCTYPE html>
<html lang="en">
<!--header-->
<include file="Public:header"/>
<!--header-->
<section id="main-content">
    <section class="wrapper">
        <h3><i class="fa fa-angle-right"></i> 添加/修改教师信息</h3>

        <!-- BASIC FORM ELELEMNTS -->
        <div class="row mt">
            <div class="col-lg-12">
                <div class="form-panel">
                    <h4 class="mb">
                        <i class="fa fa-angle-right"></i> 教师信息
                        <a class="btn btn-theme btn-default" href="{:U('index',array('currpage'=>$currpage))}">返回</a>
                    </h4>

                    <form id="myForm" class="form-horizontal style-form" method="post" action="{:U('add')}"  enctype="multipart/form-data">

                        <div class="form-group" >
                            <label class="col-sm-2 col-sm-2 control-label">教师标签/类别</label>
                            <div class="col-sm-10">
                                <if condition="$list.tags neq null">
                                    <volist name="list.tags" id="v">
                                        <div>
                                            <input <if condition="$v.choose eq true">checked</if> type="checkbox" name="tags[]" value="{$v.name}" style="margin-left: 10px;zoom: 150%;">
                                            <span style="margin-left: 5px;">{$v.name}</span>
                                        </div>
                                    </volist>
                                    <else/>
                                    <volist name="biao.tags" id="v">
                                        <div>
                                            <input type="checkbox" name="tags[]" value="{$v.name}" style="margin-left: 10px;zoom: 150%;">
                                            <span style="margin-left: 5px;">{$v.name}</span>
                                        </div>
                                    </volist>
                                </if>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label">展示图<span style="color: red;">(250px*160px)</span></label>
                            <div class="col-sm-10">
                                <input type="file" name="one" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label">头像<span style="color: red;">(250px*160px)</span></label>
                            <div class="col-sm-10">
                                <input type="file" name="two" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label">教师姓名</label>
                            <div class="col-sm-10">
                                <input id="name" name="name" value="{$list.name}" type="text"
                                       class="form-control" placeholder="请输入教师姓名">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label">教师电话</label>
                            <div class="col-sm-10">
                                <input name="phone" value="{$list.phone}" type="text"
                                       class="form-control" placeholder="请输入教师电话">
                            </div>
                        </div>
                        <div id="content" class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label">教师介绍</label>
                            <div class="col-sm-10">
                                <textarea name="intro" class="input">{$list.intro}</textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label">推荐到首页</label>
                            <div class="col-sm-10" id="type">
                                <input id="two" type="radio" name="tui" value="1" <if condition="$list.tui eq 1">checked<else/>checked</if> style="width:30px;height:30px">不推荐
                                <input id="one" type="radio" name="tui" value="2" <if condition="$list.tui eq 2">checked</if> style="width:30px;height:30px;margin-left: 20px;">推荐
                            </div>
                        </div>
                        <input type="hidden"  name="id"       value="{$list.id}">
                        <input type="hidden"  name="banner"     value="{$list.banner}">
                        <input type="hidden"  name="avatar"     value="{$list.avatar}">
                        <input type="hidden"  name="currpage" value="{$currpage}">
                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label"></label>
                            <div class="col-sm-10">
                                <input  type="submit" id="tianjia" class="btn btn-theme" value="保存" style="width: 150px;margin-left: 60px">
                                <input  type="reset" class="btn btn-warning" value="重置" style="width: 150px">
                            </div>
                        </div>
                    </form>
                    <input type="hidden" id="nums_seven" value="{$covers_shu.nums_seven}">
                </div>
            </div><!-- col-lg-12-->
        </div><!-- /row -->
    </section>
</section>

<!--footer-->
<include file="Public:footer"/>
<!--footer-->
<script type="text/javascript" src="__PUBLIC__/ui/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="__PUBLIC__/kindeditor/kindeditor.js"></script>
<script charset="utf-8" src="__PUBLIC__/kindeditor/lang/zh_CN.js"></script>
<script>

    //编辑器
    var editor;
    KindEditor.ready(function(e){
        editor = e.create("[name=intro]",{
            "width":"700px",
            "height":"300px",
            allowFileManager:true, //允许对上传图片进行管理
            "items":["source", "|", "undo", "redo", "|", "preview","|", "justifyleft", "justifycenter", "justifyright", "justifyfull", "insertorderedlist", "insertunorderedlist", "indent", "outdent", "subscript", "superscript", "clearhtml","|","formatblock", "fontname", "fontsize", "|", "forecolor", "hilitecolor", "bold", "italic", "underline","|", "image"]
        });
    });
   /* $("#tianjia").click(function(){
        editor.sync();
        var goods_type_id = $("#goods_type_id").val();
        var name          = $("#name").val();
        var yuan_moneys   = $("#yuan_moneys").val();
        var lei           = $("#lei").val();
        var intro         = $("#intro").val();
        console.log(goods_type_id,name,yuan_moneys,lei,intro);
        if(!name || (goods_type_id < 1) || !yuan_moneys || !lei || !intro){
            layer.open({
                title: '添加/修改提示：',content: '教师信息请填写完整'
            });
        }else{
            $("#myForm").submit();
        }
    });*/
</script>

</body>
</html>


